package edu.berkeley.cs160.innovationers.shoppersidekick.rpclib;

/**
 * Defines a set of methods for a client to interact with the
 * RPC server. This class is shared between the Android application
 * and the Web application/server. Note, this does not actually implement
 * the RPC methods.
 * 
 * @author Nadir Muzaffar
 *
 */
public final class ShopperSidekickProtocol { //ANDROID APPLICATION
	/**
	 * Will take care of all the synchronization details.
	 * @author Nadir Muzaffar
	 *
	 */
	public static final class Sync {
		public static final String METHOD = "sync";
	}
	
	/**
	 * Creating a list only applies to one User. Deleting a list 
	 * however could effect multiple users.
	 * 
	 * @author Nadir Muzaffar
	 *
	 */
	public static final class DeleteList{
		public static final String METHOD = "deleteList";
	}
	
	public static final class CreateList{
		public static final String METHOD = "createList";
		public static final String [] PARAMETERS = {"listName", "listCreator"}; 
		public static final String [] RETURN = { "success", };
	}
	
	/**
	 * Deleting and Adding items to a list requires an associated list.
	 * @author Nadir Muzaffar
	 *
	 */
	public static final class RemoveListItem{
		public static final String METHOD = "removeListItem";
	}
	
	public static final class AddListItem{
		public static final String METHOD = "addListItem";
		public static final String [] PARAMETERS = {"itemName", "listName", "userName", "quantity",};
		public static final String [] RETURN = { "success", };
	}
	
	
	
	/**
	 * Each user group is essentially integrated with a List. Each
	 * list has a unique group associated with it.
	 * 
	 * @author Nadir Muzaffar
	 *
	 */
	public static final class AddUserToList{
		public static final String METHOD = "addUserToList";
		public static final String [] PARAMETERS = {"user", "list"}; 
		public static final String [] RETURN = {"success", };
	}
	
	public static final class RemoveUserFromList{
		public static final String METHOD = "removeUserFromList";
		public static final String [] PARAMETERS = {"user", "list"}; 
	}
	
	public static final class RegisterDeviceWithUser{
		public static final String METHOD = "registerDeviceWithUser";
		public static final String [] PARAMETERS = {"deviceID", "userEmail"}; 
		public static final String [] RETURN = {"success", };
	}

	
	
	/**
	 * A set of test functions used to test communication between
	 * the server and the client.
	 * 
	 * @author Nadir Muzaffar
	 *
	 */
	public static final class Ping{
		public static final String METHOD = "ping";
	}
}
